﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace SelfHost.ChannelClientConsole
{
    class Program
    {
        static void Main(string[] args)
        {

            WSHttpBinding httpBind = new WSHttpBinding();



            EndpointAddress httpAds = new EndpointAddress("http://localhost:8000/Test");



            NetTcpBinding tcpBind = new NetTcpBinding();



            EndpointAddress tcpAds = new EndpointAddress("net.tcp://localhost:800/Service1");




            IMathServices httpProxy = ChannelFactory<IMathServices>.CreateChannel(httpBind, httpAds);



            IMathServices tcpProxy = ChannelFactory<IMathServices>.CreateChannel(tcpBind, tcpAds);



            using (tcpProxy as IDisposable)
            {

                Console.WriteLine(tcpProxy.Add(999, 999));

            }



            Console.ReadLine();
 

        }
    }
}
